﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DCTEDU_/HeThongMaster.master" AutoEventWireup="true"
    CodeBehind="QLThoiKhoaBieu.aspx.cs" Inherits="QuanLyThietBi.DCTEDU_.QuanTri.QLThoiKhoaBieu" %>

<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Quản lý Thời khóa biểu</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="upPanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="row">
                <div class="col-md-12">
                    <section class="panel">
            <header class="panel-heading">
                Quản lý Thời khóa biểu
                </header>  
                 <div class="panel-body">  
                 <div class="row">
                     <div class="col-xs-6">    
                     <asp:TextBox ID="txtTuKhoa" CssClass="form-control error" placeholder="Nhập tên cần tìm" Style="
    position: relative;
    bottom: 5px;" Width="200px" MaxLength="100" runat="server"></asp:TextBox>  
                     </div>
                     <div class="col-xs-6">   
                       <asp:Button ID="cmdTimKiem" runat="server" Style="float: right;margin-left: 5px; position: relative; bottom: 5px;" CausesValidation="false"  OnClick="cmdTimKiem_Click" Text="Tìm kiếm" CssClass="btn btn-primary btn-image-search" />
                      </div>  
                 </div> 
                 </div> 
                </section>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <section class="panel">
            <header class="panel-heading">
                Thời khóa biểu   
            </header>
             <div class="panel-body">   
              <section>                
              <asp:GridView ID="grvChuyenMuc" runat="server" DataKeyNames="MaTKB" Width="100%" BackColor="White"
                                    OnRowDataBound="gridCatalog2_RowDataBound" OnRowCommand="gridCatalog2_RowCommand"
                                    OnRowDeleting="gridCatalog2_RowDeleting" CssClass="table table-bordered table-striped table-condensed" EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                                    BorderColor="#CCCCCC" AutoGenerateColumns="false" BorderStyle="Solid" BorderWidth="1px"
                                        CellPadding="3">
                                    <Columns>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="STT" ItemStyle-Width="30">
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField> 
                                         <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="7%" HeaderText="Xem">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="cmdEdit" runat="server" CssClass="command_button" CausesValidation="false"
                                                    CommandName="Select" ToolTip="Click để xem chi tiết" ImageUrl="~/Images/edit.png"
                                                    CommandArgument='<%# Eval("MaTKB") %>' />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="7%" HeaderText="Xóa">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="cmdDelete" runat="server" CssClass="command_button" CausesValidation="false"
                                                    CommandName="Delete" ToolTip="Click để xóa" ImageUrl="~/Images/DeleteRed.png"
                                                    CommandArgument='<%# Eval("MaTKB") %>' />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                                        </asp:TemplateField>     
                      
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="30" HeaderText="Chọn" Visible="false">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkSelect" runat="server" />
                                                <asp:HiddenField ID="H_IdCatalog" runat="server" Value='<%# Eval("MaTKB") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>   
                                        <asp:BoundField DataField="MaLopHP"  ItemStyle-HorizontalAlign="Center" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                                            HeaderText="Mã Lớp HP"></asp:BoundField>  
                                            <asp:BoundField DataField="TuTiet"  ItemStyle-HorizontalAlign="Center" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                                            HeaderText="Từ tiết"></asp:BoundField>
                                            <asp:BoundField DataField="DenTiet"  ItemStyle-HorizontalAlign="Center" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                                            HeaderText="Đến tiết"></asp:BoundField> 
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="Thời gian bắt đầu" ItemStyle-Width="90">
                                            <ItemTemplate>
                                                <asp:Label ID="LabelThoiGian" runat="server" Text='<%# Eval("ThoiGianBatDau").ToString() != "" ? Convert.ToDateTime(Eval("ThoiGianBatDau")).ToString("dd/MM/yyyy") : ""%>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>     
                                         
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="Phòng học" ItemStyle-Width="20%">
                                            <ItemTemplate>
                                                <asp:Label ID="LabelPhongHoc" runat="server" Text='<%# GetTenPhong(Eval("MaPhong"))%>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                   <RowStyle ForeColor="#000066" />
                                        <SelectedRowStyle BackColor="#dedfdf" Font-Bold="True" ForeColor="Gray" />
                                       
                                </asp:GridView>
                                <cc1:Pager ID="Pager2" runat="server" PreviousClause="Lùi" NextClause="Tiến" LastClause=""
                                    FirstClause="" PageClause="Trang " OfClause=" /" PageSize="10" OnCommand="Pager2_Command"
                                    ForeColor="#006600" Font-Bold="True" />
              </section>
              <section>
                       <div class="panel-body">
                <div class="form-horizontal bucket-form">  
                <div class="form-group">
                    <div class="col-lg-6">
                    <asp:Button ID="cmdTaoMoi" runat="server" CausesValidation="false"  PostBackUrl="~/DCTEDU_/QuanTri/CNThoiKhoaBieu.aspx" Text="Tạo mới" CssClass="btn btn-primary  btn-image-create" />    
                     </div>
                    </div>
                </div>   
                </div>
              </section> 
              </div>
            </section>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress runat="server" ID="UpdateProgress2" AssociatedUpdatePanelID="upPanel1">
        <ProgressTemplate>
            <div style="top: 20%; right: 50%; transition: all 300ms ease 100ms;
                color: Black; padding: 8px; position: fixed; z-index: 10000">
                <asp:Image runat="server" ID="imgloading" ImageUrl="~/Images/loading.gif"/></div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</asp:Content>
